package com.medical.manage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.medical.manage.domain.Article;
import com.medical.manage.domain.vo.ArticleVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ArticleMapper extends BaseMapper<Article> {
    /**
     * 修改文章状态为 2发布成功
     * @param id
     */
    void updateStateById(@Param("id") Integer id, @Param("state") Integer state);

    /**
     * 发布文章
     * @param articleVo
     */
    int publishArticle(ArticleVo articleVo);

    /**
     * 创作文章详情
     * @param id
     * @return
     */
    ArticleVo getCreateArticleDetail(@Param("id") Integer id);

    /**
     * 推荐文章
     * @param id
     * @return
     */
    List<ArticleVo> recommendReadArticle(@Param("id") Integer id);
}
